<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/product/product_detail.css">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../css/element.css">


    <title>商品列表-商品介绍</title>
</head>

<body>
    <div id="app" v-cloak>
        <headers></headers>
        <side_nav></side_nav>

        <!-- popup -->
        <div class="ticket_list " v-show='popup_show' >
            <div class="ticket_item fl" v-for="(item,index) in ticket_list" >
                <div class="ticket_detail">
                    <div class="ticket_money">
                        <span>¥</span> {{item.couponMoney}}
                    </div>
                    <p class="can_ueser">满{{item.spendMoney}}可用</p>
                    <p class="user_data">
                        <p class="user_data">{{item.validStartTime = item.validStartTime.substring(0, 10)}}－{{item.validEndTime = item.validEndTime.substring(0, 10)}}</p>
                    </p>
                </div>
                <div class="user_limit">
                    <!-- <span class="limit_detail">使用限制：<span>{{}}</span></span> -->
                    <div v-if='item.isRecieved==""' class="ticket_btn cursor" @click='receiveCoupons(item.id)'>
                        立即领取
                    </div>
                    <div v-else class="noticket_btn cursor" @click='receiveCoupons(item.id)'>
                        已领取
                    </div>
                </div>
            </div>
            <img src="../images/close_x.png" class="cursor close_img" @click='show_popup' alt="">
            <div class="page_wrap position_bottom">
                <el-pagination background @current-change="handleCurrentChange"  page-size=ticket_size layout="prev, pager, next" :total="total" class="page_list">
                </el-pagination>
            </div>
        </div>
        <!-- search -->
        <div class="search wrap">
            <logo></logo>
            <searchs></searchs>

            <!-- <car_box></car_box> -->
            <div class="car_box fl">
                <div class="search_shop_car cursor" @click='car_box' :class="{search_car_active:car_active}">
                    <img src="../images/icon_gouwu.png" alt=""> <span class="fl">购物车（{{all_quantity}}）</span>
                </div>
                <div class="car_popup" v-show='car_active'>
                    <div class="car_popup_list">
                        <div class="car_popup_item" v-for='item in groups'>
                            <div class="car_popup_img fl">
                                <img :src='item.goodsImgs' />
                            </div>
                            <div class="car_popup_tit fl">
                                {{item.goodsName}}
                            </div>
                            <div class="car_popup_money fr">
                                <p>￥{{item.goodsPrice}} x {{item.goodsQuantity}}</p>
                            </div>
                        </div>
                    </div>
                    <div class="car_popup_footer">
                        <p class="car_all_money">共{{all_quantity}}件商品，共计￥{{all_price}}</p>
                        <p class="car_popup_btn fr cursor" @click='go_shop_car'>去购物车</p>
                    </div>
                </div>
            </div>

        </div>

        <!-- 商品分类 -->
        <div class="class_box wrap">
            <div class="sub_nav_box">
                <div class="product_class fl">
                    商品分类
                </div>
                <ul class="sub_nav fl">
                    <li @click='seckilling'>限时秒杀</li>
                    <li @click='group_buy'>团购优惠</li>
                    <li @click='cyc_buy'>周期购</li>
                    <li @click='integral'>积分商城</li>
                </ul>
            </div>
        </div>

        <div class="all_product wrap">
            全部商品&gt;{{mdseSpu.spuName}}
        </div>

        <!-- 产品 -->
        <div class="product wrap">
            <div class="product_imgs">
                <div class="product_img fl">
                    <img :src="mdseSpu.coverImg" alt="">
                    <div class="img_list fl">
                        <ul>
                            <li class="cursor" v-for='(item,index) in imgs' @click='change_img(item)'>
                                <img :src="item" alt="">
                            </li>
                        </ul>
                    </div>
                </div>

                <div class="product_detail fl">
                    <p class="product_tit">{{mdseSpu.spuName}}</p>
                    <div class="business">
                        <img :src="shopInfo.shopLogo" alt="">
                        <span class="business_name">{{shopInfo.shopName}}</span>
                        <el-progress class="star_num" :text-inside="true" :stroke-width="4" :percentage="i" color="rgba(204,24,24,1)"></el-progress>
                        <span class="star_text">{{is}}分</span>
                        <div class="collection fr">
                            收藏
                            <img src="../images/icon_star.png" class="collection_star cursor fr" @click='collection(mdseSpu.id)' alt="" v-if='collectStatus==1'>
                            <img src="../images/icon_shoucang.png" class="collection_star cursor fr" @click='collection(mdseSpu.id)' alt="" v-else='collectStatus==0'>
                        </div>
                    </div>
                    <div class="product_detail_tit">
                        <div class="tit fl pirce">价格<i> </i></div>
                        <div class="price_detail fl"><span>￥</span>{{show_pirce}}</div>
                    </div>
                    <div class="product_detail_tit">
                        <div class="tit fl discount_ticket">优惠券<i> </i></div>
                        <div class="discount_list">
                            <ul>
                                <li class="discount_item" v-for='(item,index) in listCouponsNoToken' v-if='index<4'>满{{item.spendMoney}}减{{item.couponMoney}}</li>
                                <li class="more_discount cursor" @click='show_popup'>更多 &gt;</li>
                            </ul>
                        </div>
                    </div>
                    <div class="product_detail_tit">
                        <div class="tit fl">库存<i> </i></div>
                        <div class="promotion fl">{{stock}}</div>
                    </div>


                    <div class="product_detail_tit">
                        <div class="tit fl">品牌<i> </i></div>
                        <div class="promotion fl">{{brandInfo.brandName}}</div>
                    </div>

                    <div class="product_detail_tit" v-for='(item,indexs) in chooseSkuList'>
                        <div class="shuxing fl discount_ticket">{{item.specInfo}}<i> </i></div>
                        <div class="discount_list">
                            <ul>
                                <li class="style_item" v-for='(style_items,index) in item.specValues' @click='style_item(index,indexs,item.specId)'
                                    :class="{active:item.myindex==index}">{{style_items.specValueInfo}}</li>
                            </ul>
                        </div>
                    </div>

                    <div class="product_detail_tit">
                        <div class="tit fl send_address">数量<i> </i></div>
                        <el-input-number v-model="nums" @change="handleChange" size="mini" :min="1" :max="stock" label=""></el-input-number>
                    </div>

                </div>
            </div>
            <div class="clear_both">
                
                <div class="buy_box fr">
                    <div class="add_shop_car cursor" @click='iscg'>
                        加入购物车
                    </div>
                    <div class="buy_now cursor" @click='buy_now'>
                        立即购买
                    </div>
                </div>
            </div>
        </div>



        <!-- 优惠组合 -->
        <!-- <div class="discount_box wrap">
            <div class="discount_tit">
                <span>优惠组合</span>
            </div>
            <div class="group_list clear_both">
                <div class="group_item_wrap fl">
                    <div class="group_item">

                    </div>
                    <div class="item_name">
                        QXD-25 小双槽qxd细度计
                        25微米颗粒刮板细度计
                    </div>
                </div>
                <div class="item_add fl">
                    +
                </div>
                <div class="group_item_wrap fl">
                    <div class="group_item">

                    </div>
                    <div class="item_name">
                        QXD-25 小双槽qxd细度计
                        25微米颗粒刮板细度计
                    </div>
                    <div class="group_num"><span>￥</span>56000</div>
                </div>
                <div class="group_item_wrap fl">
                    <div class="group_item">

                    </div>
                    <div class="item_name">
                        QXD-25 小双槽qxd细度计
                        25微米颗粒刮板细度计
                    </div>
                    <div class="group_num"><span>￥</span>56000</div>
                </div>
                <div class="group_item_wrap fl">
                    <div class="group_item">

                    </div>
                    <div class="item_name">
                        QXD-25 小双槽qxd细度计
                        25微米颗粒刮板细度计
                    </div>
                    <div class="group_num"><span>￥</span>56000</div>
                </div>
                <div class="deng fl">=</div>
                <div class="group_money fl">
                    <div class="money_tit">组合价</div>
                    <div class="group_num"><span>￥</span>56000</div>
                    <div class="group_btn">立即购买</div>
                </div>
            </div>
        </div> -->

        <div class="sort wrap">
            <div class="sort_list">
                <!-- <li v-for='(item,index) in tabsParam' @click="toggleTabs(index)" :class="{active:nowIndex===index}">{{item}}</li> -->
                <!-- <li v-for="(item,index) in tabsParam" @click="toggleTabs(index)" :class="{active:index!=nowIndex}">{{item}}</li> -->
                <p :class="{active:nowIndex===0}" class="fl" @click="introduce">商品介绍</p>
                <p :class="{active:nowIndex===1}" class="fl" @click="packing">规格与包装</p>
                <p :class="{active:nowIndex===2}" class="fl" @click="comment">商品评价{{evalute_num}}</p>
            </div>
        </div>
        <!-- 商品介绍 -->
        <div class="product_introduce ql-editor details_wrap wrap" v-show="nowIndex===0" v-html='details.details'> 
            <!-- {{details.details}} -->
        </div>
        <!-- 规格与包装 -->
        <div class="packing wrap ql-editor details_wrap" v-show="nowIndex===1">
            <div class="packing_item" v-for='(item,index) in spuPropertyList'>
                <ul>
                    <li>{{item.propertyName}}：{{item.value}}</li>
                </ul>
            </div>
        </div>

        <!-- 评价 -->
        <div class="comment_box wrap" v-show="nowIndex===2">
            <div class="comment_nav">
                <ul>
                    <li :class="{active:evalute_index==0}" @click='gcl(0,1)'>全部({{evalute_num}})</li>
                    <li :class="{active:evalute_index==4}" @click='gcl(4,1)'>有图({{youtu}})</li>
                    <li :class="{active:evalute_index==3}" @click='gcl(3,1)'>好评({{haoping}})</li>
                    <li :class="{active:evalute_index==2}" @click='gcl(2,1)'>中评({{zhongping}})</li>
                    <li :class="{active:evalute_index==1}" @click='gcl(1,1)'>差评({{chaping}})</li>
                </ul>
            </div>
            <div class="comment_containe">
                <div class="comment_item" v-for='item in gcl_list'>
                    <div class="left_box fl">
                        <div class="comment_person">
                            <div class="person_pic fl">
                                <img :src="item.userVia" alt="">
                            </div>
                            <div class="person_name fl">{{item.userNickname}}</div>
                        </div>
                    </div>
                    <div class="fl">
                        <div class="star_list">
                            <el-rate
                                v-model="item.starShowAvg"
                                disabled
                                text-color="#CC1818"
                            >
                            </el-rate>

                        </div>
                        <div class="comment_text">{{item.content}}</div>
                        <div class="comment_img_list">
                            <ul>
                                <li v-for='item in item.img_list'>
                                    <img :src="item" alt="">
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="integral_page wrap">
                <el-pagination background @current-change="handleCurrentChanges" :page-size="10" :current-page="currentPages"  layout="prev, pager, next" :total="evalute_num" class="page_list">
                </el-pagination>
            </div>
        </div>
       <div class="wrap clear_both">             <productfooter></productfooter>         </div>

    </div>
    <!-- <iframe src="../footer/product_footer.html" style="width:100%;" frameborder="0"></iframe> -->
    <script src="../js/axios.js"></script>         <script src="../js/qs.js"></script>
    <script src="../js/browser.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../js/element.js"></script>
    <script src="../js/main.js"></script>
    <script type="text/babel">
        var app = new Vue({
            el: '#app',
            data() {
                return {
                    books:20,
                    nums: 1,
                    comments:5,
                    tabsParam:['商品介绍','规格与包装','商品评价'],
                    nowIndex:0,
                    style_num:0,
                    car_active:false,
                    groups:3,
                    style_list:['QXD-25','QXD-26','QXD-27','QXD-28'],
                    id:'',
                    shao_id:'',
                    userId:localStorage.getItem('userId'),
                    // 评价条数
                    evalute_total:0,
                    shopInfo:'',
                    mdseInfo:'',
                    popup_show:false,
                    ticket_list:'',
                    total:0,
                    shopId:'',
                    ticket_size:6,
                    imgs:'',
                    mdseSpu:'',
                    collectStatus:'',
                    details:'',
                    chooseSkuList:'',
                    spuPropertyList:[],
                    specValueIds:'',
                    show_pirce:'',
                    stock:'',
                    gcl_list:'',
                    evalute_pic:'',
                    evalute_num:0,
                    chaping:0,
                    youtu:0,
                    haoping:0,
                    zhongping:0,
                    evalute_index:0,
                    listCouponsNoToken:'',
                    quantity:1,
                    skuid:'',
                    i:0,
                    is:0,
                    evaluate:'',
                    currentPages:1,
                    // 购物车
                    car_active: false,
                    groups: '',
                    all_quantity: 0,
                    all_price: 0
                };
            },
            components: {
            },
            created() {
            },
            mounted() {
                if (this.userId==''||this.userId==undefined||this.userId==null) {
                    this.userId = ''
                }
                this.id = this.GetQueryString().id
                this.getMdseDetails()
                this.scgq()
                this.wscl()
            },
            methods: {
                // 购物车
                car_box() {
                    if (this.car_active == false) {
                        this.car_active = true
                    } else if (this.car_active == true) {
                        this.car_active = false
                    }
                    // this.car_active = !this.car_active
                },
                go_shop_car() {
                    window.location.href = '../product/shop_car.html'
                },
                // 购物车

                scgq() {
                    var that = this
                    axios({
                            method: "POST",
                            url: base_url + "/sc/scgq",
                            data: Qs.stringify({}),
                            headers: {
                                'Content-Type': 'application/x-www-form-urlencoded',
                                "TOKEN": localStorage.getItem('wACCESS_TOKEN')
                            }
                        })
                        .then(function (res) {
                            // that.quantity = res.data.data.quantity
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                },
                wscl() {
                    var that = this
                    axios({
                            method: "POST",
                            url: base_url + "/sc/wscl",
                            data: Qs.stringify({}),
                            headers: {
                                'Content-Type': 'application/x-www-form-urlencoded',
                                "TOKEN": localStorage.getItem('wACCESS_TOKEN')
                            }
                        })
                        .then(function (res) {
                            that.groups = res.data.data.list
                            var all_quantity = 0
                            var all_price = 0
                            for (let i = 0; i < res.data.data.list.length; i++) {
                                all_quantity += res.data.data.list[i].goodsQuantity
                            }
                            for (let j = 0; j < res.data.data.list.length; j++) {
                                all_price += res.data.data.list[j].goodsQuantity * res.data.data.list[j].goodsPrice
                            }
                            that.all_price = all_price.toFixed(2)
                            that.all_quantity = all_quantity
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                },
                handleCurrentChanges(value){
                    this.gcl(this.evaluate,value)
                    this.currentPages = value
                },
                // 立即购买
                buy_now(){
                    if (localStorage.getItem('wACCESS_TOKEN')==null) {
                        this.$message.error('请登录');
                    }else{
                        window.location.href='shop_one.html?id='+this.skuInfo.id+'&num=' + this.nums
                    }
                },
                // 添加购物车
                iscg(){
                    axios({
                        method:"POST",
                        url:base_url + "/sc/iscg",
                        data:Qs.stringify({
                            // activitiesId:'',
                            skuId:this.skuid,
                            quantity:this.quantity,
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        console.log(res)
                        if (res.data.code==1) {
                            app.$message.success('添加成功');
                            app.wscl()
                        }else  {
                            app.$message.error(res.data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },

                // 评论列表
                gcl(status,page){
                    this.evaluate = status
                    this.currentPages = 1
                    axios({
                        method:"POST",
                        url:base_url + "/occ/gcl",
                        data:Qs.stringify({
                            pageSize:10,
                            pageNum:page,
                            status:this.evaluate,
                            goodsId:this.mdseSpu.id
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.evalute_index = status                       
                        app.gcl_list = res.data.data.list.list.map(function (item) {
                            var new_item = item
                            if (item.images!=''&&item.images!=undefined&&item.images!=null) {
                                new_item.img_list = item.images.split(',')
                            }
                            // if (0<=item.starShowAvg<=3) {
                            //     new_item.starShowAvg = 1
                            // }else if (4<=item.starShowAvg<=6) {
                            //     new_item.starShowAvg = 2
                            // }else if (7<=item.starShowAvg<=9) {
                            //     new_item.starShowAvg = 3
                            // }else if (10<=item.starShowAvg<=12) {
                            //     new_item.starShowAvg = 4
                            // }else if (13<=item.starShowAvg<=15) {
                            //     new_item.starShowAvg = 5
                            // }
                            return new_item
                        })
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 获取分数
                
                // gcas(){
                //     axios({
                //         method:"POST",
                //         url:base_url + "/occ/gcas",
                //         data:Qs.stringify({
                //             goodsId:this.mdseSpu.id
                //         }),
                //         headers:{
                //             'Content-Type':'application/x-www-form-urlencoded',
                //             "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                //         }
                //     })
                //     .then(function (res) {
                //         console.log(res.data)
                //         if (res.data.data.i==null||res.data.data.i==''||res.data.data.i==undefined) {
                //             app.i = 0
                //         }else{
                //             app.i = res.data.data.i
                //         }
                //     })
                //     .catch(function (error) {
                //         console.log(error);
                //     });
                // },
                // 获取评价数量
                gclnum(){
                    axios({
                        method:"POST",
                        url:base_url + "/occ/gcsc",
                        data:Qs.stringify({
                            // goodsId:123,
                            goodsId:this.mdseSpu.id
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        if (res.data.code==-1) {
                            app.$message.error(res.data.msg);
                        }else{
                            var object = res.data.data.data
                            app.chaping = object.cp
                            app.youtu = object.yt
                            app.haoping = object.hp
                            app.evalute_num = object.qb
                            app.zhongping = object.zp
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 进入时默认的sku
                sku(){
                    var specValueIds = ''
                    for (let i = 0; i < this.chooseSkuList.length; i++) {
                        specValueIds += this.chooseSkuList[i].specValues[0].specValue+','
                    }
                    specValueIds = specValueIds.substring(0, specValueIds.lastIndexOf(','))  ;
                    this.specValueIds = specValueIds.split(',')
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/getSkuInfoBySpec",
                        data:Qs.stringify({
                            specValueIds:specValueIds,
                            spuId:this.mdseSpu.id
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.skuInfo = res.data.data.skuInfo
                        app.show_pirce = res.data.data.skuInfo.salesPrice
                        app.stock = res.data.data.skuInfo.stock
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                
                // sku
                style_item(index,indexs) {
                    app.chooseSkuList[indexs].myindex=index
                    var specValueIds = this.specValueIds
                    specValueIds[indexs] = app.chooseSkuList[indexs].specValues[index].specValue
                    specValueIds = specValueIds.join(',')
                    this.specValueIds = specValueIds.split(',')
                    console.log(this.specValueIds)
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/getSkuInfoBySpec",
                        data:Qs.stringify({
                            specValueIds:specValueIds,
                            spuId:this.mdseSpu.id
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.skuInfo = res.data.data.skuInfo
                        app.show_pirce = res.data.data.skuInfo.salesPrice
                        app.stock = res.data.data.skuInfo.stock
                        app.skuid = res.data.data.skuInfo.id
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 点击切换图片
                change_img(item){
                    this.mdseSpu.coverImg = item
                },
                // 收藏
                collection(id){
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/collectMdse",
                        data:Qs.stringify({
                            spuId:id,
                            collectStatus:this.collectStatus
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        if (res.data.code==1) {
                            app.collectStatus = res.data.data.collectStatus
                            app.$message.success('添加成功');
                        }else  {
                            app.$message.error(res.data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 分页
                handleCurrentChange(page) {
                    this.listCoupons(page)
                }, //改变条数触发
                handleIndexChange(index) {
                    console.log(index)
                },
                // 领取优惠券
                show_popup(){
                    if (localStorage.getItem('wACCESS_TOKEN') == '' ||localStorage.getItem('wACCESS_TOKEN') == undefined ||localStorage.getItem('wACCESS_TOKEN') == null) {
                        app.$message.error('请登录');
                    }else{
                        this.popup_show = !this.popup_show
                    }
                },
                // 领取
                receiveCoupons(id){
                    axios({
                        method:"POST",
                        url:base_url + "/coupons/receiveCoupons",
                        data:Qs.stringify({
                            couponId:id
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        if (res.data.code==1) {
                            app.popup_show = false
                            app.$message.success(res.data.msg);
                        }else if(res.data.code==0){
                            app.$message.error(res.data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 优惠券
                listCoupons(page){
                    axios({
                        method:"POST",
                        url:base_url + "/coupons/listCoupons",
                        data:Qs.stringify({
                            shopId:this.shopId,
                            pageNum:page,
                            pageSize:this.ticket_size
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.total = res.data.data.list.total
                        app.ticket_list = res.data.data.list.list
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                listCouponsNoTokens(page){
                    axios({
                        method:"POST",
                        url:base_url + "/coupons/listCouponsNoToken",
                        data:Qs.stringify({
                            shopId:this.shopId,
                            pageNum:page,
                            pageSize:this.ticket_size
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.listCouponsNoToken = res.data.data.list.list
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                
                getMdseDetails(){
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/getMdseDetails",
                        data:Qs.stringify({
                            spuId:this.id,
                            userId:this.userId,
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.brandInfo = res.data.data.brandInfo
                        app.shopInfo = res.data.data.shopInfo
                        app.i = Number(res.data.data.shopInfo.shopPoint)*20
                        app.is = Number(res.data.data.shopInfo.shopPoint)
                        console.log('i='+app.i)
                        app.mdseInfo = res.data.data.mdseInfo
                        app.mdseSpu = res.data.data.mdseInfo.mdseSpu
                        app.shopId = res.data.data.shopInfo.id
                        app.collectStatus = res.data.data.collectStatus
                        app.details = res.data.data.mdseInfo.details
                        app.spuPropertyList = res.data.data.mdseInfo.spuPropertyList
                        console.log(app.spuPropertyList)
                        // for (let i = 0; i < app.spuPropertyList.length; i++) {
                        //     if (condition) {
                                
                        //     }
                        // }
                        app.chooseSkuList = res.data.data.chooseSkuList.map(function(item) {
                            let newItem=item
                            newItem.myindex=0
                            return  newItem
                        });
                        var imgs = res.data.data.mdseInfo.mdseSpu.imgs.slice(0,res.data.data.mdseInfo.mdseSpu.imgs.length-1)
                        app.imgs = imgs.split(',')
                        console.log(imgs)
                        app.listCoupons(1)
                        app.listCouponsNoTokens(1)
                        app.sku()
                        app.gcl(0,1)
                        app.style_item(0,0)
                        app.gclnum()
                        // app.gcas()
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 截取url
                GetQueryString() {
                    var obj = new Object()
                    var scan_url = window.location.href.split('?')[1];
                    var strs = scan_url.split('&');
                    for(var x in strs) {
                        var arr = strs[x].split('=');
                        obj[arr[0]] = arr[1]
                    }
                    return obj
                },
                // 显示购物车               
                go_shop_car(){                     
                    window.location.href='../product/shop_car.html'  
                },
                car_box(){
                    this.car_active = !this.car_active
                },
                handleChange(value) {
                    this.quantity = value
                },
                introduce:function(index){
                    app.nowIndex = 0
                },
                packing:function(index){
                    app.nowIndex = 1
                },
                comment:function(index){
                    app.nowIndex = 2
                },
               
                seckilling(){
                    window.location.href='../discount/seckilling.html'
                },
                cyc_buy(){
                    window.location.href='../discount/cyc_buy.html'
                },
                group_buy(){
                    window.location.href='../discount/group_buy.html'
                },
                integral(){
                    window.location.href='../integral/integral.html'
                },
            }
        })
    </script>
</body>

</html>